import request from '@/utils/request'

export function getPage(data) {
  return request({
    url: `/base/page?baseName=${data.baseName}&page=${data.page}&limit=${data.limit}`,
    method: 'get' // query
  })
}

export function getSchoolPage(data) {
  return request({
    url: `/school/page?schoolName=${data.schoolName}&page=${data.page}&limit=${data.limit}`,
    method: 'get' // query
  })
}

export function addBase(data) {
  return request({
    url: `/base/addBase`,
    method: 'post',
    data: data // body
  })
}

export function addBaseByTemplate(data) { // 上传文件
  return request({
    url: `/base/addBaseByTemplate`,
    method: 'post',
    headers: {
      'Content-Type': 'multipart/form-data'
    },
    data: data // body
  })
}

export function updateBase(data) {
  return request({
    url: `/base/updateBase`,
    method: 'post',
    data: data
  })
}

export function deleteBase(data) {
  return request({
    url: `/base/deleteBase?baseId=${data.baseId}`,
    method: 'post'
  })
}

export function deleteBases(data) {
  return request({
    url: `/base/deleteBases?baseIds=${data.item}`,
    method: 'post'
  })
}
